Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client gametest screenshot changes #4329

Merged

Conversation

Earthcomputer
Copy link
Contributor

@Earthcomputer Earthcomputer commented Dec 26, 2024

  • Screenshots are now instant, you no longer have to wait a tick for them to render the current state.
    • The frame is re-rendered explicitly for the purpose of taking the screenshot. This allows us to set the tickDelta value to 1, improving consistency.
    • The option to delay before taking a screenshot has been removed. You can still manually create a delay before a screenshot by using context.waitTick() and context.waitTicks(delay).
    • This has exposed other footguns with client gametests, though. In some cases, the game needs to tick to be able to process an action, such as with some key binds which are polled, and when a packet needs to be sent to the server (which we have fixed to take exactly 1 tick in gametest singleplayer). To be able to see the effects of your actions, you may need to wait ticks before taking a screenshot. I have decided to not wait a tick before taking screenshots though, as this is observable in other ways than just this, and unlike before, the screenshots are a reflection of the real state of the game.
  • Screenshots now add a counter prefix to their filename by default, so that they appear in the same order in the file explorer as they were taken.
  • Added more configuration options to taking a screenshot:
    • Option to disable the counter prefix.
    • Option to change the tickDelta to something other than 1.
    • Option to change the screenshot resolution.
    • Option to change the screenshot save directory.
  • Consistent window sizes
    • The window size according to the game always starts at (854, 480) (or whatever is set in the command line options), regardless of if the window manager overrides the physical size of the window.
    • If the physical window is resized either by the user or window manager, this will not affect the game (e.g. how widgets are layed out in GUIs, the screenshot resolutions, etc). The content of the window may appear stretched to the user, but this does not affect screenshots.
    • Added a programmatic way to resize the window in a way that is visible to the game.
  • Automated screenshot comparisons are left to a future PR.

@Earthcomputer Earthcomputer force-pushed the client-gametest-screenshot-changes branch from 89e89cf to 0441c30 Compare December 28, 2024 17:12
@modmuss50 modmuss50 added enhancement New feature or request last call If you care, make yourself heard right away! test merge me please Pull requests that are ready to merge labels Dec 28, 2024
@modmuss50 modmuss50 merged commit 1f6471e into FabricMC:1.21.4 Dec 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request last call If you care, make yourself heard right away! merge me please Pull requests that are ready to merge test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants